home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / vol_100 / 105_01 / coefset.c < prev    next >
Encoding:
Text File  |  1984-06-03  |  768 b   |  24 lines

  1. /**   ******** coefset.c ********
  2. obtain printout of and test of floating point constants
  3. so that they can be initialized with initb 
  4.     C. Calhoun
  5.     257 South Broadway
  6.     Lebanon, Ohio 45036   513 932 4541 / 433 7510
  7. 2 May 1981   */
  8.     main ()
  9. {
  10.    char *atof(),op1[5],s[80],op2[5];
  11.    char *gets();
  12. while (1) {
  13.    printf ("\nEnter Coef. ");
  14.     gets(s);
  15.    atof(op1,s);
  16.    printf ("\n Four decimal equivalents %D %D %D %D %D ",
  17.     op1[0],op1[1],op1[2],op1[3],op1[4]);
  18.    sprintf(s,"%d,%d,%d,%d,%d \200",op1[0],op1[1],op1[2],op1[3],op1[4]);
  19.     printf("\n String Value %s",s);
  20.    initb(op2,s);
  21.     printf("\n NEW VALUE %-25.17e",op2);
  22.        }
  23. }
  24.